package week_08;

public class IsPalindrome_I_125 {
    public boolean isPalindrome(String s) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) >= 'a' && s.charAt(i) <= 'z') sb.append(s.charAt(i));
            if (s.charAt(i) >= 'A' && s.charAt(i) <= 'Z') sb.append((char) (s.charAt(i) + 32));
            if (s.charAt(i) >= '0' && s.charAt(i) <= '9') sb.append(s.charAt(i));
        }
        s = sb.toString();
        int start = 0;
        int end = s.length() - 1;
        while (start < end) {
            if (s.charAt(start) != s.charAt(end)) return false;
            start++;
            end--;
        }
        return true;
    }

    public static void main(String[] args) {
        IsPalindrome_I_125 test = new IsPalindrome_I_125();
        String s = "0P";
        System.out.println(test.isPalindrome(s));
        ;
    }
}
